<template>
  <right-template :title="componentData.title" :tabName="componentData.tabName">
    <el-form class="right-upload">
      <input-normal label="导出表头" v-model="commonAttr.tableName" @change="onChangeAttr"></input-normal>
      <input-normal label="限制上传文件大小(M)" placeholder="2" v-model="commonAttr.uploadLimitSize" @change="onChangeAttr"></input-normal>
      <switch-normal v-model="commonAttr.need" label="设为必选项" @change="onChangeAttr"></switch-normal>
      <add-img-con :url="commonAttr.imgUrl" comAttr="commonAttr" picAttr="imgUrl" class="margin-left-right-16"></add-img-con>
      <input-normal label="默认图片" v-model="commonAttr.imgUrl" @change="onChangeAttr"></input-normal>
      <switch-normal v-model="commonAttr.isDisplayDeleteBtn" label="显示删除按钮" @change="onChangeAttr"></switch-normal>
      <slider-normal v-model="commonAttr.uploadCount" label="限制上传数量" :max="5" :step="1" @change="onChangeAttr"></slider-normal>
      <dropdown-normal label="截图类型" :valLists="SAVE_IMG_DATA_TYPES" v-model="commonAttr.saveImgType" @change="onChangeAttr"></dropdown-normal>
      <input-normal v-if="commonAttr.saveImgType == SAVE_IMG_DATA_TYPES[0].value" v-model="commonAttr.saveImgQuality" label="图片质量" placeholder="0.8"  @change="onChangeAttr"></input-normal>
    </el-form>
  </right-template>
</template>


<script>
import RightTemplate from '@/views/child/right/right-template.vue'
import InputNormal from '@/views/components/edit/InputNormal.vue'
import SwitchNormal from '@/views/components/edit/SwitchNormal.vue'
import SliderNormal from '@/views/components/edit/SliderNormal.vue'
import DropdownNormal from '@/views/components/edit/DropdownNormal.vue'
import AddImgCon from '@/views/components/add-img-con.vue'
import { SAVE_IMG_DATA_TYPES } from '@/common/events'
import { editUtils } from '@/views/js/edit-utils'

export default {
  name: "RightUpload",
  mixins: [editUtils],
  setup () {
    return {
      SAVE_IMG_DATA_TYPES: SAVE_IMG_DATA_TYPES,
    }
  },
  components: {
    RightTemplate,
    InputNormal,
    SwitchNormal,
    SliderNormal,
    DropdownNormal,
    AddImgCon
  },
};
</script>
